package com.vhall.component.controller.room.facade;

import com.alibaba.fastjson.JSONObject;
import com.vhall.component.entity.room.vo.*;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 *
 * 房间服务
 * @author guoxin.wang
 * @date 2021/7/12 17:30
 */
@FeignClient(value = "RoomFacade", path = "/v4/room")
public interface RoomFacade {

    /**
     * 获取房间属性信息
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @PostMapping(value = "/get-attributes")
    RoomAttrRespVO getAttributes(@Validated RoomAttrVO reqVO);

    /**
     * 获取房间 直播信息接口
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @PostMapping(value = "/get-room-extends-info")
    RoomExtendRespVO getRoomExtendsInfo(@Validated RoomAttrVO reqVO);


    /**
     * 自定义标签,菜单
     *
     * @param reqVO
     * @return
     */
    @PostMapping(value = "/custom-tag")
    JSONObject customMenu(@Validated CustomMenuListVO reqVO);


    /**
     * 开始直播推流接口
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @PostMapping(value = "/start-live")
    Boolean startLive(@Validated StartLiveVO reqVO);

    /**
     * 前端先调用这个接口生成默认回放，然后再调用 end-live
     */
    @PostMapping(value = "/gen-default-record")
    Boolean genDefaultRecord(@Validated EndLiveVO reqVO);

    /**
     * 结束推流接口
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @PostMapping(value = "/end-live")
    Boolean endLive(@Validated EndLiveVO reqVO);


    /**
     * 获取房间信息
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @PostMapping(value = "/get")
    RoomDetailRespVO getRoomDetail(@Validated RoomAttrVO reqVO);

    /**
     * 主持人状态通知接口
     *
     * @param reqVO
     * @return
     */
    @PostMapping(value = "/master-status-notice")
    Boolean masterStatusNotice(@Validated MasterStatusNoticeVO reqVO);

    /**
     * 检查是否是主持人
     *
     * @param reqVO 请求参数
     * @return 0=否 1=是
     */
    @GetMapping(value = "/is-anchor")
    Integer isAnchor(@Validated CheckIsAnchorReqVO reqVO);


    /**
     * 提交点播转直播任务
     *
     * @param reqVO 请求参数
     * @return 0=否 1=是
     */
    @GetMapping(value = "/auto-play")
    JSONObject submitVODToLive(@Validated SubmitVODToLiveVO reqVO);


    /**
     * 获取流状态
     *
     * @param roomIds 请求参数
     */
    @GetMapping(value = "/get-stream-status")
    JSONObject getStreamStatus(@RequestParam("roomIds") String roomIds);

    /** 兴业     * 判断当前人员是否预约
     * true 预约 false 没有预约
     */
    @PostMapping(value = "/judge/reservation")
    Boolean judgeReservationOrNot(@Validated CheckIsAnchorReqVO reservationVO);

    /**
     * 兴业  * 预约或者取消预约
     */
    @PostMapping(value = "/reservation")
    Boolean reservationOrNot(@Validated ReservationVO reservationVO);

    /**
     * 提交举报
     */
    @PostMapping(value = "/report/report")
    ReportRoomRspVO reportRoom(@Validated ReportRoomReqVO vo);

    /**
     * 获取举报配置
     */
    @PostMapping(value = "/report/config-list")
    List<ReportConfigRspVO> getReportConfigList(@Validated ReportConfigReqVO vo);

    /**
     * 获取房间版本信息
     */
    @GetMapping(value = "/get_have_sdkversion")
    String getHaveSDKVersion();

    /**
     * 设置房间版本信息
     */
    @GetMapping(value = "/set_have_sdkversion")
    Boolean settingHaveSDKVersion(@RequestParam("version") String version);

    /**
     * 兴业    获取房间权限登录信息
     */
//    @PostMapping(value = "/get-limit-type")
    @RequestMapping(value = "/get-limit-type", method = {RequestMethod.POST,RequestMethod.GET})
    RoomLimitTypeRspVO getLimitType(@RequestParam("room_id") String roomId);


    /**
     * 获取房间风险提示
     * @param roomId roomId: lss开头
     * @return RiskWarningSmallVO
     */
    @PostMapping("/risk-warning")
    RiskWarningSmallVO getRoomRiskWarning(@RequestParam("room_id") String roomId);

    /**
     * 观看直播限制
     * - 调用国信接口实现整个显示能力
     * @param vo
     * @return 是否可以进行直播观看
     */
    @TokenAuth
    @PostMapping("/live-watch-limit")
    LiveWatchCheckResponseVO liveWatchLimit(@Validated LiveWatchCheckRequestVO vo);

    /**
     * 设置美颜系数
     * @param number 数值
     * @return
     */
    @PostMapping("/set/beauty-coefficient")
    Boolean setBeautyCoefficient(@RequestParam("number") Integer number);

    /**
     * 查询美颜数值
     * @return
     */
    @GetMapping("/beauty-coefficient")
    Integer getBeautyCoefficient();

    @PostMapping("/virtual-pv")
    Long getVirtualPV(@RequestParam("il_id") Integer ilId);
}
